
--解锁帧数
--japi.UnlockFps(true)
--关闭平台锁镜头距离
for a=1,12 do
    local player = ac.player[a]
    if player:is_player() then
        japi.RequestExtraBooleanData(43, player.handle, nil, nil, false, 1, 0, 0) 
    end
end


local camera_distacen = 2200
local camera_distacen_min = 1200
local camera_distacen_max = 3000

ac.player.self:set_camera_field('镜头距离', camera_distacen, 0.1)
ac.hardware:on "鼠标滑轮滚动" (function (_,flag)
    local x, y = ac.hardware:get_mouse_pos()
    if ac.game:dispatch('本地-鼠标滚动', x, y) then
        return true 
    end 


    if flag then
        camera_distacen = camera_distacen - 50
    else
        camera_distacen = camera_distacen + 50
    end
    if camera_distacen > camera_distacen_max then
        camera_distacen = camera_distacen_max
    elseif camera_distacen < camera_distacen_min then
        camera_distacen = camera_distacen_min
    end


    local dis_now = camera_distacen
    ac.player.self:set_camera_field('镜头距离', dis_now, 0.1)

    return true
end)

